home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-05-01 | 2.9 KB | 94 lines | [TEXT/MPS ] |
- % ---------------------------------------------------------------------------
- % Class MACDialogMgr
- %
- % In this module you find the programmers interface to Dialogs and Alerts.
- % It is built on top of the TOOLBOX routines in TOOLBOXDialog.
- % For a description of the routines see Inside Macintosh, chapter 13.
- % MacDialogAlert is only used as prefix on MacDialog and MacAlert
- %
- % 890317/Boris Magnusson
- % 890412/Göran Eriksson
- %
- % ---------------------------------------------------------------------------
- external class MACRect="::SInterfaces:MACRect";
- external class MACWindow="::SInterfaces:MACWindow";
- external class MACWindowMgr="::SInterfaces:MACWindowMgr";
- external class MACEvent="::SInterfaces:MACEvent";
- external class MACDialog="::SInterfaces:MACDialog";
- external class ToolboxDialog="::SInterfaces:ToolboxDialog";
-
- ToolboxDialog class MacDialogMgr(theMacWindowMgr);
- ref(MacWindowMgr) theMacWindowMgr;
- begin
- short integer nil=0;
- ref(MACDialog) ActDialog;
-
- % PROCEDURE InitDialogs(resumeProc: ProcPtr);
- PROCEDURE InitDialogs(resumeProc);
- integer resumeProc;
- ToolboxInitDialogs(resumeProc);
-
- % FUNCTION IsDialogEvent(event: EventRecord): BOOLEAN;
- boolean procedure IsDialogEvent(event);
- ref(MACEvent) event;
- IsDialogEvent:=ToolboxIsDialogEvent(event.what);
-
- % FUNCTION DialogSelect(event: EventRecord; VAR theDialog: DialogPtr;
- % VAR itemHit: INTEGER): BOOLEAN;
- boolean procedure DialogSelect(event,theDialog,itemHit);
- name theDialog, itemHit;
- ref(MACEvent) Event;
- ref(MACDialog) theDialog;
- short integer itemHit;
- begin
- integer WD;
- short integer LocaIItemHit;
- DialogSelect:=ToolboxDialogSelect(event.what, WD, LocaIItemHit);
- if WD=ActDialog.WindowPtr then
- theDialog:-ActDialog
- else
- begin
- theDialog:-none;
- DialogSelect:=false;
- end;
- itemHit:= LocaIItemHit;
- end;
-
-
- % PROCEDURE ModalDialog(filterProc: ProcPtr; VAR itemHit: INTEGER);
- PROCEDURE ModalDialog(filterProc, itemHit);
- name itemHit;
- integer filterProc;
- short integer itemHit;
- begin
- short integer LocalItemHit;
- ToolboxModalDialog(filterProc, LocalItemHit);
- itemHit:=LocalItemHit;
- end;
-
-
- % PROCEDURE CloseDialog(theDialog: DialogPtr);
- PROCEDURE CloseDialog(theDialog);
- ref(MACDialog) theDialog;
- ToolboxCloseDialog(theDialog.WindowPtr);
-
- % PROCEDURE DisposDialog(theDialog: DialogPtr);
- PROCEDURE DisposDialog(theDialog);
- ref(MACDialog) theDialog;
- ToolboxDisposDialog(theDialog.WindowPtr);
-
- % PROCEDURE ParamText(cite0, cite1, cite2, cite3: Str255);
- PROCEDURE ParamText(cite0, cite1, cite2, cite3);
- text cite0, cite1, cite2, cite3;
- ToolboxParamText(cite0, cite1, cite2, cite3);
-
- % PROCEDURE ErrorSound(sound: ProcPtr);
- PROCEDURE ErrorSound(sound);
- integer sound;
- ToolboxErrorSound(sound);
- % -----------------------------------------
- procedure RegisterDialog(D); ref(MacDialog) D;
- theMacWindowMgr.RegisterWindow(D);
- % ------------------------------------------
-
- end;